package com.tfj.mvp.tfj.detail.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.ImageButton;
import android.widget.RelativeLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hyphenate.tfj.R;
import com.tfj.mvp.tfj.detail.advisor.VAdvisorActivity;
import com.tfj.mvp.tfj.detail.advisor.detail.VAdvisorDetailActivity;
import com.tfj.mvp.tfj.detail.bean.AdvisorBean;
import com.tfj.mvp.tfj.per.logreg.VLogActivity;
import com.tfj.utils.AntiShakeUtils;

public class QuickAdapter_Advisor extends BaseQuickAdapter<AdvisorBean, BaseViewHolder> {
    private Context context ;
    public QuickAdapter_Advisor(Context context) {
        super(R.layout.item_advisor);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder viewHolder, final AdvisorBean item) {
        RelativeLayout rl_out = viewHolder.getView(R.id.rl_out);
        ImageButton imageBtn_tel = viewHolder.getView(R.id.imageBtn_tel);
        ImageButton imagebtn_chat = viewHolder.getView(R.id.imagebtn_chat);
        imageBtn_tel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (AntiShakeUtils.isInvalidClick(v))
                    return;
                context.startActivity(new Intent(context, VLogActivity.class));

            }
        });
        rl_out.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (AntiShakeUtils.isInvalidClick(v))
                    return;
                context.startActivity(new Intent(context, VAdvisorDetailActivity.class));
            }
        });
    }
}
